package com.example.qingyiapp.ui.activity;

import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;

import com.example.qingyiapp.R;
import com.example.qingyiapp.ui.activity.fragment.fragment_MenuUI.Childfragment.Login_child_fragment;
import com.example.qingyiapp.ui.activity.fragment.fragment_MenuUI.LoginAdapter.Login_fragment_adpter;

import java.util.ArrayList;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;

public class UserActivity extends AppCompatActivity {

    @BindView(R.id.tab_user)
    TabLayout tab_user;
    @BindView(R.id.vp_user)
    ViewPager vp_user;
    Unbinder unbinder;
    ArrayList<String> strings = new ArrayList<>();
    ArrayList<Fragment> fragments = new ArrayList<>();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_user);
        unbinder = ButterKnife.bind(this);
        strings.clear();
        fragments.clear();
        strings.add("动态");
        strings.add("游记");
        strings.add("攻略");
        strings.add("点评");
        strings.add("行程");
        strings.add("问答");
        strings.add("结伴");
        fragments.add(new Login_child_fragment());
        fragments.add(new Login_child_fragment());
        fragments.add(new Login_child_fragment());
        fragments.add(new Login_child_fragment());
        Login_fragment_adpter login_fragment_adpter = new Login_fragment_adpter(getSupportFragmentManager(), strings, fragments);
        vp_user.setAdapter(login_fragment_adpter);
        tab_user.setupWithViewPager(vp_user);


    }
    @Override
    public void onDestroy() {
        super.onDestroy();
        unbinder.unbind();
    }


}
